package com.yonyou.cyxdms.basedata.service.entity.smstemplate;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.io.Serializable;

/**
 * <p>
 * 短信模板
 * </p>
 *
 * @author dengqiang
 * @since 2019-09-19
 */
@TableName("tm_sms_template")
public class SmsTemplatePO extends DMSBasePO<SmsTemplatePO> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "SMS_TEMPLATE_ID", type = IdType.AUTO)
    private Long smsTemplateId;

    /**
     * APP_ID
     */
    @TableField("APP_ID")
    private String appId;
    /**
     * 公司代码
     */
    @TableField("COMPANY_CODE")
    private String companyCode;
    /**
     * 所有者代码
     */
    @TableField("OWNER_CODE")
    private String ownerCode;
    /**
     * 所有者的父组织代码（用于二网使用）
     */
    @TableField("OWNER_PAR_CODE")
    private String ownerParCode;
    /**
     * 短信模板类型(1572)
     */
    @TableField("SMS_TEMPLATE_TYPE")
    private String smsTemplateType;
    /**
     * 短信模板名称
     */
    @TableField("SMS_TEMPLATE_NAME")
    private String smsTemplateName;
    /**
     * 短信模板内容
     */
    @TableField("SMS_TEMPLATE_CONTENT")
    private String smsTemplateContent;
    /**
     * 是否默认
     */
    @TableField("IS_DEFAULT")
    private Integer isDefault;
    /**
     * 数据来源(1045)
     */
    @TableField("DATA_SOURCES")
    private Integer dataSources;

    public SmsTemplatePO() {
        super();
    }


    public Long getSmsTemplateId() {
        return smsTemplateId;
    }

    public void setSmsTemplateId(Long smsTemplateId) {
        this.smsTemplateId = smsTemplateId;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public String getOwnerCode() {
        return ownerCode;
    }

    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }

    public String getOwnerParCode() {
        return ownerParCode;
    }

    public void setOwnerParCode(String ownerParCode) {
        this.ownerParCode = ownerParCode;
    }

    public String getSmsTemplateType() {
        return smsTemplateType;
    }

    public void setSmsTemplateType(String smsTemplateType) {
        this.smsTemplateType = smsTemplateType;
    }

    public String getSmsTemplateName() {
        return smsTemplateName;
    }

    public void setSmsTemplateName(String smsTemplateName) {
        this.smsTemplateName = smsTemplateName;
    }

    public String getSmsTemplateContent() {
        return smsTemplateContent;
    }

    public void setSmsTemplateContent(String smsTemplateContent) {
        this.smsTemplateContent = smsTemplateContent;
    }

    public Integer getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(Integer isDefault) {
        this.isDefault = isDefault;
    }

    public Integer getDataSources() {
        return dataSources;
    }

    public void setDataSources(Integer dataSources) {
        this.dataSources = dataSources;
    }

    @Override
    protected Serializable pkVal() {
        return this.smsTemplateId;
    }

    @Override
    public String toString() {
        return "SmsTemplatePO{" +
                "smsTemplateId=" + smsTemplateId +
                ", appId=" + appId +
                ", companyCode=" + companyCode +
                ", ownerCode=" + ownerCode +
                ", ownerParCode=" + ownerParCode +
                ", smsTemplateType=" + smsTemplateType +
                ", smsTemplateName=" + smsTemplateName +
                ", smsTemplateContent=" + smsTemplateContent +
                ", isDefault=" + isDefault +
                ", dataSources=" + dataSources +
                "}";
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author dengqiang
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "smsTemplateId");
    }


}
